package com.renbang.action.devoloper;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import com.renbang.dao.sqlsession.DBUtils;


@Controller
@RequestMapping(value = "/developer")
public class DeveloperAction{
	@Value("#{dataSource['url']}")
	private String URL;
	@Value("#{dataSource['driverClassName']}")
	private String DRIVER;
	@Value("#{dataSource['username']}")
	private String USER;
	@Value("#{dataSource['password']}")
	private String PASS;
	
	@RequestMapping(value = "/{page}")
	public String redirect(@PathVariable("page") String page1) {
		if(DBUtils.DRIVER==null||DBUtils.DRIVER.equals("")){
			DBUtils.setConnection(DRIVER, URL, USER, PASS);
		}
		return "developer/" + page1;
	}

}